var jwt = require('jsonwebtoken')
var secretOrPrivateKey = 'jwtSecret'

var Jwt = {
	setJwt: function (content) {
		var token = jwt.sign(content,secretOrPrivateKey)
		return token
	},
	getJwt: function (token,callback){
		jwt.verify(token,secretOrPrivateKey,function(err,decode){
			// console.log("decodesd: "+decode)
			callback(err,decode)
		})
	}
}

module.exports = Jwt
